package org.lgiavedoni.android.franq.event.generation.phone;

import org.lgiavedoni.android.franq.core.listener.PhoneStateListener;
import org.lgiavedoni.android.franq.event.GSMCellChangeEvent;
import org.lgiavedoni.android.franq.service.event.EventService;
import org.lgiavedoni.android.franq.service.phone.listener.PhoneListenerService;

import android.telephony.CellLocation;

public class GsmCellLocationListener extends PhoneStateListener {

	@Override
	public int getEventListener() {
		return PhoneStateListener.LISTEN_CELL_LOCATION;
	}

	@Override
	public void onCellLocationChanged(CellLocation location) {
		if (PhoneListenerService.inst.isStarted()) {
			GSMCellChangeEvent e = new GSMCellChangeEvent(location);
			EventService.inst.fireEvent(e);
		}
	}

}
